dataset_name = 'yeast'

fid = fopen('dag.txt');

tline = fgetl(fid);
num_node = str2double(tline);
dag = zeros(num_node, num_node);

tline = fgetl(fid);
while ischar(tline)
    array_line = str2num(tline);
    
    node_i = array_line(1) + 1;
    num_parent_i = array_line(2);
    if num_parent_i >= 1
        parent_i = array_line(3:end) + 1;
        dag(parent_i, node_i) = 1;
    end
    
    tline = fgetl(fid);
end

fclose(fid);

flag = is_dag(dag)
if flag
    save(['dag_', dataset_name], 'dag')
end
